#pragma once
#include <iostream>
#include <string>
#include "../Comm/Util.hpp"

namespace ns_log
{
    using namespace ns_util;
    enum
    {
        INFO,
        DEBUG,
        WARNING,
        ERROR,
        FATAL
    };
    inline static std::ostream &log(const std::string &level, const std::string &name, int line)
    {
        std::string message;
        message += "[";
        message += level;
        message += "]";
        message += "[";
        message += name;
        message += "]";
        message += "[";
        message += std::to_string(line);
        message += "]";

        message += "[";
        message += TimeUtil::getTimeStemp();
        message += "]";

        std::cout << message;
        return std::cout;
    }
#define LOG(level) log(#level, __FILE__, __LINE__)
}